<?php

declare (strict_types = 1);

namespace app\model\system;

use own\interface\OwnModelInteface;

class UserModel extends OwnModelInteface
{
    protected $name = 'system_user';

    protected $field = [];

    /**
     * 角色
     */
    public function role() {
        return $this->hasOne(RoleModel::class, 'id', 'role_id')->field('id,name,alias,status');
    }
    /**
     * 部门
     */
    public function dept() {
        return $this->hasOne(DeptModel::class, 'id', 'dept_id')->field('id,name,leader,phone,status');
    }
    
}
